import request from '@/utils/request'

export function getPermissionOptions() {
  return request({
    url: '/courses/permissions',
    method: 'get'
  })
}

export function getCourseTypes() {
  return request({
    url: '/courses/types',
    method: 'get'
  })
}

export function getCourseList(query) {
  return request({
    url: '/courses',
    method: 'get',
    params: query
  })
}

export function pushMessage(data) {
  return request({
    url: `/courses/xxPush`,
    method: 'post',
    data
  })
}

export function getCourse(id) {
  return request({
    url: `/courses/${id}/edit`,
    method: 'get'
  })
}

export function createCourse(data) {
  return request({
    url: `/courses`,
    method: 'post',
    data
  })
}

export function updateCourse(id, data) {
  return request({
    url: `/courses/${id}`,
    method: 'put',
    data
  })
}

export function deleteCourse(id) {
  return request({
    url: `/courses/${id}`,
    method: 'delete'
  })
}

export function UpdateStatus(query) {
  return request({
    url: '/courses/UpdateStatus',
    method: 'get',
    params: query
  })
}

export function wxPush(data) {
  return request({
    url: `/courses/wxPush`,
    method: 'post',
    data
  })
}

